package model;

import java.io.File;
import java.io.Serializable;
import java.util.Date;

/**
 * The Event class is responsible for storing individual case events.
 *
 * @author Kevin, Tim
 * @version 2014-05-25
 */
public class Event implements Serializable {

    private int Id;
    private Date date;
    private String comment;
    private File file;

    /**
     * Class constructor
     *
     * @param Id sets the event id
     * @param date sets event date
     * @param comment adds comments to the event
     * @param file the fiels to be added to the event
     */
    public Event(int Id, Date date, String comment, File file) {
        this.Id = Id;
        this.date = date;
        this.comment = comment;
        this.file = file;
    }

    // <editor-fold defaultstate="collapsed" desc=" GET&SET METHODS ">
    /**
     * Gets event ID
     *
     * @return event ID
     */
    public int getId() {
        return Id;
    }

    /**
     * Sets event ID
     *
     * @param Id
     */
    public void setId(int Id) {
        this.Id = Id;
    }

    /**
     * Gets event date
     *
     * @return event date
     */
    public Date getDate() {
        return date;
    }

    /**
     * Sets event date
     *
     * @param date
     */
    public void setDate(Date date) {
        this.date = date;
    }

    /**
     * Gets comment
     *
     * @return comment
     */
    public String getComment() {
        return comment;
    }

    /**
     * Sets comment
     *
     * @param comment
     */
    public void setComment(String comment) {
        this.comment = comment;
    }

    /**
     * Gets registered file
     *
     * @return file
     */
    public File getFile() {
        return file;
    }

    /**
     * Sets registered file
     *
     * @param file
     */
    public void setFile(File file) {
        this.file = file;
    }
    // </editor-fold>

    /**
     * Enum defining event data fields
     */
    public enum Field {

        EVENT_ID("Id"),
        EVENT_DATE("Datum"),
        EVENT_DESCRIPTION("Beskrivning"),
        EVENT_FILE("Ladda upp fil");

        private final String fieldName;

        private Field(String fieldName) {
            this.fieldName = fieldName;
        }

        @Override
        public String toString() {
            return fieldName;
        }
    }
}
